//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.andromeda.androbench2;

import android.annotation.TargetApi;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.content.DialogInterface.OnClickListener;
import android.content.SharedPreferences.Editor;
import android.content.pm.PackageManager.NameNotFoundException;
import android.graphics.Typeface;
import android.os.Bundle;
import android.os.Environment;
import android.text.Html;
import android.text.method.LinkMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.AdapterView.OnItemClickListener;
import java.io.File;
import java.util.ArrayList;

public class Setting extends CustomActivity {
    static final int KBYTE = 1024;
    static final int MBYTE = 1048576;
    static final String UNKNOWN = "unknown";
    private Setting.GroupAdapter adapter;
    private ArrayList<Data> al_Settings;
    private ListView listview;
    Context mContext;
    SharedPreferences sp_Data;
    Editor sp_e_Data;
    TextView tv_available_filesize_info;
    TextView tv_helpinfo;
    TextView tv_html;
    TextView tv_one_fs;
    TextView tv_rnd_bs;
    TextView tv_rnd_recs;
    TextView tv_rnd_ts;
    TextView tv_seq_bs;
    TextView tv_setting_transactionsize;
    TextView tv_thread;
    TextView tv_total_fs;
    TextView tv_transactionsize;

    static {
        System.loadLibrary("Interface_JNI");
    }

    public Setting() {
    }

    public static native int FILE_OPEN(String var0);

    private void setIndexUsage(int var1) {
        this.sp_e_Data.remove("IndexUsage");
        this.sp_e_Data.putInt("IndexUsage", var1);
        this.sp_e_Data.commit();
        this.al_Settings.remove(6);
        ArrayList var6 = this.al_Settings;
        StringBuilder var7 = (new StringBuilder()).append("");
        String var8;
        if (this.sp_Data.getInt("IndexUsage", 0) == 1) {
            var8 = "YES";
        } else {
            var8 = "NO";
        }

        var6.add(6, new Data("SQLite Index Usage", "Select index usage for SQLite", var7.append(var8).toString()));
        this.listview.setAdapter(this.adapter);
    }

    private void setJournalMode(String var1) {
        this.sp_e_Data.remove("JournalMode");
        this.sp_e_Data.putString("JournalMode", var1);
        this.sp_e_Data.commit();
        this.al_Settings.remove(5);
        this.al_Settings.add(5, new Data("SQLite Journal Mode", "Select journal mode for SQLite", this.sp_Data.getString("JournalMode", "")));
        this.listview.setAdapter(this.adapter);
    }

    private void setTargetBufferSize(int var1, int var2) {
        int var3 = this.sp_Data.getInt("OneFileSize", 0);
        int var4 = this.sp_Data.getInt("TestRecs_RAND", 0);
        if (var3 < var1) {
            Builder var5 = new Builder(this);
            var5.setMessage("The sequential buffer size \nshould be less than\nthe file size per thread (" + var3 / 1024 + "MB)").setCancelable(false).setPositiveButton("Ok", new OnClickListener() {
                public void onClick(DialogInterface var1, int var2) {
                }
            });
            var5.setTitle("Help");
            var5.setCancelable(true);
            AlertDialog var9 = var5.create();
            var9.show();
            CustomActivity.setSelector((ViewGroup)var9.getWindow().getDecorView());
            CustomActivity.setGlobalFont((ViewGroup)var9.getWindow().getDecorView());
        } else if (var3 < var4 * var2) {
            Builder var10 = new Builder(this);
            var10.setMessage("The random buffer size \nshould be less than " + var3 / var4 + "KB").setCancelable(false).setPositiveButton("Ok", new OnClickListener() {
                public void onClick(DialogInterface var1, int var2) {
                }
            });
            AlertDialog var12 = var10.create();
            var12.setTitle("Help");
            var12.setCancelable(true);
            var12.show();
            CustomActivity.setSelector((ViewGroup)var12.getWindow().getDecorView());
            CustomActivity.setGlobalFont((ViewGroup)var12.getWindow().getDecorView());
        } else if (var1 > 0 && (var1 & var1 - 1) != 0) {
            Builder var22 = new Builder(this);
            var22.setMessage("The sequential buffer size \nshould be powers of 2 (KB)").setCancelable(false).setPositiveButton("Ok", new OnClickListener() {
                public void onClick(DialogInterface var1, int var2) {
                }
            });
            AlertDialog var24 = var22.create();
            var24.setTitle("Help");
            var24.setCancelable(true);
            var24.show();
            CustomActivity.setSelector((ViewGroup)var24.getWindow().getDecorView());
            CustomActivity.setGlobalFont((ViewGroup)var24.getWindow().getDecorView());
        } else if (var2 > 0 && (var2 & var2 - 1) != 0) {
            Builder var19 = new Builder(this);
            var19.setMessage("The random buffer size \nshould be powers of 2 (KB)").setCancelable(false).setPositiveButton("Ok", new OnClickListener() {
                public void onClick(DialogInterface var1, int var2) {
                }
            });
            AlertDialog var21 = var19.create();
            var21.setTitle("Help");
            var21.setCancelable(true);
            var21.show();
            CustomActivity.setSelector((ViewGroup)var21.getWindow().getDecorView());
            CustomActivity.setGlobalFont((ViewGroup)var21.getWindow().getDecorView());
        } else {
            this.sp_e_Data.remove("BufferSize_SEQ");
            this.sp_e_Data.putInt("BufferSize_SEQ", var1);
            this.sp_e_Data.remove("BufferSize_RND");
            this.sp_e_Data.putInt("BufferSize_RND", var2);
            this.sp_e_Data.commit();
            this.al_Settings.remove(2);
            this.al_Settings.add(2, new Data("Buffer Size", "Change buffer size for sequential & random access", "SEQ: " + this.sp_Data.getInt("BufferSize_SEQ", 0) + " KB" + "  RND: " + this.sp_Data.getInt("BufferSize_RND", 0) + " KB"));
            this.listview.setAdapter(this.adapter);
        }
    }

    private void setTargetDatabaseSize(int var1) {
        if (1 <= var1 && var1 <= 10) {
            this.sp_e_Data.remove("DatabaseSize");
            this.sp_e_Data.putInt("DatabaseSize", var1);
            this.sp_e_Data.commit();
            this.al_Settings.remove(9);
            this.al_Settings.add(9, new Data("SQLite Initial Database Size", "Change size for initial database size for SQLite", "Size: " + this.sp_Data.getInt("DatabaseSize", 0)));
            this.listview.setAdapter(this.adapter);
        } else {
            Builder var2 = new Builder(this);
            var2.setMessage("The database size \nshould be in range of (1, 10)").setCancelable(false).setPositiveButton("Ok", new OnClickListener() {
                public void onClick(DialogInterface var1, int var2) {
                }
            });
            var2.setTitle("Help");
            var2.setCancelable(true);
            AlertDialog var6 = var2.create();
            var6.show();
            CustomActivity.setSelector((ViewGroup)var6.getWindow().getDecorView());
            CustomActivity.setGlobalFont((ViewGroup)var6.getWindow().getDecorView());
        }
    }

    private void setTargetDevice(int var1) {
        this.sp_e_Data.remove("TargetDevice");
        this.sp_e_Data.putInt("TargetDevice", var1);
        this.sp_e_Data.commit();
        String var5;
        if (this.sp_Data.getInt("TargetDevice", 0) == 0) {
            var5 = "/data";
        } else {
            var5 = MemoryStatus.getSDExternalPath(this.mContext);
        }

        this.al_Settings.remove(0);
        this.al_Settings.add(0, new Data("Target Partition", "Select partition to test", var5));
        this.listview.setAdapter(this.adapter);
    }

    private void setTargetNumThread(int var1) {
        if (1 <= var1 && var1 <= 32) {
            this.sp_e_Data.remove("Num_Thread");
            this.sp_e_Data.putInt("Num_Thread", var1);
            this.sp_e_Data.commit();
            this.al_Settings.remove(3);
            this.al_Settings.add(3, new Data("Threads", "Change number of threads for random read/write", "Threads:" + this.sp_Data.getInt("Num_Thread", 0)));
            this.listview.setAdapter(this.adapter);
        } else {
            Builder var2 = new Builder(this);
            var2.setMessage("The number of threads \nshould be a positive number\nless than or equal to 32").setCancelable(false).setPositiveButton("Ok", new OnClickListener() {
                public void onClick(DialogInterface var1, int var2) {
                }
            });
            var2.setTitle("Help");
            var2.setCancelable(true);
            AlertDialog var6 = var2.create();
            var6.show();
            CustomActivity.setSelector((ViewGroup)var6.getWindow().getDecorView());
            CustomActivity.setGlobalFont((ViewGroup)var6.getWindow().getDecorView());
        }
    }

    private void setTargetOneFileSize(int var1) {
        int var2 = this.sp_Data.getInt("TestRecs_RAND", 0);
        int var3 = this.sp_Data.getInt("Num_Thread", 0);
        int var4 = this.sp_Data.getInt("BufferSize_SEQ", 0);
        int var5 = this.sp_Data.getInt("BufferSize_RND", 0);
        int var7;
        if (this.sp_Data.getInt("TargetDevice", 0) == 0) {
            var7 = (int)(MemoryStatus.getAvailableInternalMemorySize() / 1024L);
        } else {
            int var6 = this.sp_Data.getInt("TargetDevice", 0);
            var7 = 0;
            if (var6 == 1) {
                var7 = (int)(MemoryStatus.getAvailableSDExternalMemorySize(this.mContext) / 1024L);
            }
        }

        if (var1 < var4) {
            Builder var8 = new Builder(this);
            var8.setMessage("The file size per thread \nshould be larger than\nthe sequential buffer size (" + var4 + "KB)").setCancelable(false).setPositiveButton("Ok", new OnClickListener() {
                public void onClick(DialogInterface var1, int var2) {
                }
            });
            var8.setTitle("Help");
            var8.setCancelable(true);
            AlertDialog var12 = var8.create();
            var12.show();
            CustomActivity.setSelector((ViewGroup)var12.getWindow().getDecorView());
            CustomActivity.setGlobalFont((ViewGroup)var12.getWindow().getDecorView());
        } else if (var1 < var2 * var5) {
            Builder var13 = new Builder(this);
            var13.setMessage("The file size per thread \nshould be larger than " + var2 * var5 / 1024 + "MB").setCancelable(false).setPositiveButton("Ok", new OnClickListener() {
                public void onClick(DialogInterface var1, int var2) {
                }
            });
            var13.setTitle("Help");
            var13.setCancelable(true);
            AlertDialog var17 = var13.create();
            var17.show();
            CustomActivity.setSelector((ViewGroup)var17.getWindow().getDecorView());
            CustomActivity.setGlobalFont((ViewGroup)var17.getWindow().getDecorView());
        } else if (var7 < var1 * var3) {
            Builder var18 = new Builder(this);
            String var19;
            if (this.sp_Data.getInt("TargetDevice", 0) == 0) {
                var19 = "The total file size \nshould be less than\nthe Free Space (" + "/data";
            } else if (this.sp_Data.getInt("TargetDevice", 0) == 1) {
                var19 = "The total file size \nshould be less than\nthe Free Space (" + MemoryStatus.getSDExternalPath(this.mContext);
            } else {
                var19 = "The total file size \nshould be less than\nthe Free Space (" + "unknown";
            }

            var18.setMessage(var19 + ": " + var7 / 1024 + "MB)").setCancelable(false).setPositiveButton("Ok", new OnClickListener() {
                public void onClick(DialogInterface var1, int var2) {
                }
            });
            AlertDialog var21 = var18.create();
            var21.setTitle("Help");
            var21.setCancelable(true);
            var21.show();
            CustomActivity.setSelector((ViewGroup)var21.getWindow().getDecorView());
            CustomActivity.setGlobalFont((ViewGroup)var21.getWindow().getDecorView());
        } else {
            this.sp_e_Data.remove("OneFileSize");
            this.sp_e_Data.putInt("OneFileSize", var1);
            this.sp_e_Data.commit();
            this.al_Settings.remove(1);
            this.al_Settings.add(1, new Data("File Size", "Change read/write file size", "" + this.sp_Data.getInt("OneFileSize", 0) / 1024 + " MB"));
            this.listview.setAdapter(this.adapter);
        }
    }

    private void setTargetTransactionSize(int var1) {
        if (1 <= var1 && var1 <= 64) {
            this.sp_e_Data.remove("TransactionSize");
            this.sp_e_Data.putInt("TransactionSize", var1);
            this.sp_e_Data.commit();
            this.al_Settings.remove(4);
            this.al_Settings.add(4, new Data("SQLite Transaction Size", "Change size of transaction for SQLite", "" + this.sp_Data.getInt("TransactionSize", 0)));
            this.listview.setAdapter(this.adapter);
        } else {
            Builder var2 = new Builder(this);
            var2.setMessage("The transaction size \nshould be in range of (1, 64)").setCancelable(false).setPositiveButton("Ok", new OnClickListener() {
                public void onClick(DialogInterface var1, int var2) {
                }
            });
            var2.setTitle("Help");
            var2.setCancelable(true);
            AlertDialog var6 = var2.create();
            var6.show();
            CustomActivity.setSelector((ViewGroup)var6.getWindow().getDecorView());
            CustomActivity.setGlobalFont((ViewGroup)var6.getWindow().getDecorView());
        }
    }

    @TargetApi(8)
    void ItemClick(AdapterView<?> var1, View var2, int var3, long var4) {
        if (var3 == 0) {
            ArrayList var6 = new ArrayList();
            var6.add("/data");
            String var8 = MemoryStatus.getSDExternalPath(this.mContext);
            if (!var8.equals("unknown")) {
                String var16 = this.getExternalFilesDir((String)null).toString().replaceFirst(Environment.getExternalStorageDirectory().getAbsolutePath(), var8);
                File var17 = new File(var16);
                if (!var17.exists()) {
                    var17.mkdirs();
                }

                if (FILE_OPEN(var16) > 0) {
                    var6.add(var8);
                }
            }

            ArrayAdapter var9 = new ArrayAdapter(this, R.layout.custom_spinner_dropdown_item, var6);
            Builder var10 = new Builder(this);
            var10.setTitle("Target Partition");
            int var12 = this.sp_Data.getInt("TargetDevice", 0);
            OnClickListener var13 = new OnClickListener() {
                public void onClick(DialogInterface var1, int var2) {
                    Setting.this.setTargetDevice(var2);
                    var1.dismiss();
                }
            };
            var10.setSingleChoiceItems(var9, var12, var13);
            AlertDialog var15 = var10.create();
            var15.getListView().setSelector(R.drawable.custom_list_selector);
            var15.show();
            CustomActivity.setSelector((ViewGroup)var15.getWindow().getDecorView());
            CustomActivity.setGlobalFont((ViewGroup)var15.getWindow().getDecorView());
        } else {
            if (var3 == 1) {
                Context var84 = this.getApplicationContext();
                View var85 = ((LayoutInflater)var84.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.dlg_setting_filesize, (ViewGroup)null);
                Builder var86 = new Builder(this);
                var86.setView(var85);
                var86.setTitle("File Size / Thread");
                this.tv_available_filesize_info = (TextView)var85.findViewById(R.id.et_setting_info);
                this.tv_total_fs = (TextView)var85.findViewById(R.id.et_setting_totalfilesize);
                this.tv_one_fs = (TextView)var85.findViewById(R.id.et_setting_onefilesize);
                this.tv_one_fs.setText(Integer.toString(this.sp_Data.getInt("OneFileSize", 0) / 1024));
                String var89;
                if (MemoryStatus.getAvailableInternalMemorySize() < 0L) {
                    var89 = "Free Space (/data): Not available\n";
                } else {
                    var89 = "Free Space (/data): " + MemoryStatus.getAvailableInternalMemorySize() / 1048576L + " MB\n";
                }

                long var90 = MemoryStatus.getAvailableSDExternalMemorySize(var84);
                String var92;
                if (var90 < 0L) {
                    var92 = "";
                } else {
                    var92 = "Free Space (/storage/extSdCard): " + var90 / 1048576L + " MB\n";
                }

                this.tv_total_fs.setText("Total File Size: " + this.sp_Data.getInt("Num_Thread", 0) * (this.sp_Data.getInt("OneFileSize", 0) / 1024) + " MB\n");
                this.tv_available_filesize_info.setText(var89 + var92);
                OnClickListener var93 = new OnClickListener() {
                    public void onClick(DialogInterface var1, int var2) {
                        Setting.this.setTargetOneFileSize(1024 * Integer.parseInt("0" + Setting.this.tv_one_fs.getText().toString()));
                    }
                };
                var86.setPositiveButton("Apply", var93);
                OnClickListener var95 = new OnClickListener() {
                    public void onClick(DialogInterface var1, int var2) {
                    }
                };
                var86.setNegativeButton("Cancel", var95);
                AlertDialog var97 = var86.create();
                var97.show();
                CustomActivity.setSelector((ViewGroup)var97.getWindow().getDecorView());
                CustomActivity.setGlobalFont((ViewGroup)var97.getWindow().getDecorView());
                return;
            }

            if (var3 == 2) {
                View var75 = ((LayoutInflater)this.getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.dlg_setting_buffersize, (ViewGroup)null);
                Builder var76 = new Builder(this);
                var76.setView(var75);
                var76.setTitle("Buffer Size");
                this.tv_seq_bs = (TextView)var75.findViewById(R.id.et_setting_seq_buffersize);
                this.tv_seq_bs.setText(Integer.toString(this.sp_Data.getInt("BufferSize_SEQ", 0)));
                this.tv_rnd_bs = (TextView)var75.findViewById(R.id.et_setting_rnd_buffersize);
                this.tv_rnd_bs.setText(Integer.toString(this.sp_Data.getInt("BufferSize_RND", 0)));
                OnClickListener var79 = new OnClickListener() {
                    public void onClick(DialogInterface var1, int var2) {
                        Setting.this.setTargetBufferSize(Integer.parseInt("0" + Setting.this.tv_seq_bs.getText().toString()), Integer.parseInt("0" + Setting.this.tv_rnd_bs.getText().toString()));
                    }
                };
                var76.setPositiveButton("Apply", var79);
                OnClickListener var81 = new OnClickListener() {
                    public void onClick(DialogInterface var1, int var2) {
                    }
                };
                var76.setNegativeButton("Cancel", var81);
                AlertDialog var83 = var76.create();
                var83.show();
                CustomActivity.setSelector((ViewGroup)var83.getWindow().getDecorView());
                CustomActivity.setGlobalFont((ViewGroup)var83.getWindow().getDecorView());
                return;
            }

            if (var3 == 3) {
                View var66 = ((LayoutInflater)this.getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.dlg_setting_numthread, (ViewGroup)null);
                Builder var67 = new Builder(this);
                var67.setView(var66);
                var67.setTitle("Threads");
                this.tv_thread = (TextView)var66.findViewById(R.id.et_setting_thread);
                this.tv_thread.setText(Integer.toString(this.sp_Data.getInt("Num_Thread", 0)));
                OnClickListener var70 = new OnClickListener() {
                    public void onClick(DialogInterface var1, int var2) {
                        Setting.this.setTargetNumThread(Integer.parseInt("0" + Setting.this.tv_thread.getText().toString()));
                    }
                };
                var67.setPositiveButton("Apply", var70);
                OnClickListener var72 = new OnClickListener() {
                    public void onClick(DialogInterface var1, int var2) {
                    }
                };
                var67.setNegativeButton("Cancel", var72);
                AlertDialog var74 = var67.create();
                var74.show();
                CustomActivity.setSelector((ViewGroup)var74.getWindow().getDecorView());
                CustomActivity.setGlobalFont((ViewGroup)var74.getWindow().getDecorView());
                return;
            }

            if (var3 == 4) {
                View var57 = ((LayoutInflater)this.getApplicationContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.dlg_setting_transactionsize, (ViewGroup)null);
                Builder var58 = new Builder(this);
                var58.setView(var57);
                var58.setTitle("SQLite Transaction Size");
                this.tv_setting_transactionsize = (TextView)var57.findViewById(R.id.tv_setting_transactionsize);
                this.tv_setting_transactionsize.setText("Transaction Size (1-64) - Default: 1");
                this.tv_transactionsize = (TextView)var57.findViewById(R.id.et_setting_transactionsize);
                this.tv_transactionsize.setText(Integer.toString(this.sp_Data.getInt("TransactionSize", 0)));
                OnClickListener var61 = new OnClickListener() {
                    public void onClick(DialogInterface var1, int var2) {
                        Setting.this.setTargetTransactionSize(Integer.parseInt("0" + Setting.this.tv_transactionsize.getText().toString()));
                    }
                };
                var58.setPositiveButton("Apply", var61);
                OnClickListener var63 = new OnClickListener() {
                    public void onClick(DialogInterface var1, int var2) {
                    }
                };
                var58.setNegativeButton("Cancel", var63);
                AlertDialog var65 = var58.create();
                var65.show();
                CustomActivity.setSelector((ViewGroup)var65.getWindow().getDecorView());
                CustomActivity.setGlobalFont((ViewGroup)var65.getWindow().getDecorView());
                return;
            }

            if (var3 == 5) {
                ArrayList var20 = new ArrayList();
                var20.add("DELETE");
                var20.add("PERSIST");
                var20.add("WAL");
                ArrayAdapter var24 = new ArrayAdapter(this, R.layout.custom_spinner_dropdown_item, var20);
                Builder var25 = new Builder(this);
                var25.setTitle("SQLite Journal Mode\nDefault: WAL");
                String var27 = this.sp_Data.getString("JournalMode", "WAL");
                byte var28 = 2;
                if (var27.equals("DELETE")) {
                    var28 = 0;
                } else if (var27.equals("PERSIST")) {
                    var28 = 1;
                } else if (var27.equals("WAL")) {
                    var28 = 2;
                }

                System.out.println("journal mode: " + var27 + ", chknum: " + var28);
                OnClickListener var29 = new OnClickListener() {
                    public void onClick(DialogInterface var1, int var2) {
                        switch(var2) {
                            case 0:
                                Setting.this.setJournalMode("DELETE");
                                break;
                            case 1:
                                Setting.this.setJournalMode("PERSIST");
                                break;
                            case 2:
                                Setting.this.setJournalMode("WAL");
                        }

                        var1.dismiss();
                    }
                };
                var25.setSingleChoiceItems(var24, var28, var29);
                AlertDialog var31 = var25.create();
                var31.getListView().setSelector(R.drawable.custom_list_selector);
                var31.show();
                CustomActivity.setSelector((ViewGroup)var31.getWindow().getDecorView());
                CustomActivity.setGlobalFont((ViewGroup)var31.getWindow().getDecorView());
                return;
            }

            if (var3 == 6) {
                ArrayList var32 = new ArrayList();
                var32.add("YES");
                var32.add("NO");
                ArrayAdapter var35 = new ArrayAdapter(this, R.layout.custom_spinner_dropdown_item, var32);
                Builder var36 = new Builder(this);
                var36.setTitle("SQLite Index Usage\nDefault: YES");
                byte var38;
                if (this.sp_Data.getInt("IndexUsage", 0) == 1) {
                    var38 = 0;
                } else {
                    var38 = 1;
                }

                OnClickListener var39 = new OnClickListener() {
                    public void onClick(DialogInterface var1, int var2) {
                        Setting var3 = Setting.this;
                        byte var4;
                        if (var2 == 0) {
                            var4 = 1;
                        } else {
                            var4 = 0;
                        }

                        var3.setIndexUsage(var4);
                        var1.dismiss();
                    }
                };
                var36.setSingleChoiceItems(var35, var38, var39);
                AlertDialog var41 = var36.create();
                var41.getListView().setSelector(R.drawable.custom_list_selector);
                var41.show();
                CustomActivity.setSelector((ViewGroup)var41.getWindow().getDecorView());
                CustomActivity.setGlobalFont((ViewGroup)var41.getWindow().getDecorView());
                return;
            }

            if (var3 == 7) {
                Builder var42 = new Builder(this);
                Builder var43 = var42.setMessage(Html.fromHtml("<p>Please visit<br> <a href=\"http://www.androbench.org/wiki/User_Guide\">http://www.androbench.org/wiki/User_Guide</a></p>")).setCancelable(false);
                OnClickListener var44 = new OnClickListener() {
                    public void onClick(DialogInterface var1, int var2) {
                    }
                };
                var43.setPositiveButton("Ok", var44);
                var42.setTitle("Help");
                var42.setCancelable(true);
                OnClickListener var48 = new OnClickListener() {
                    public void onClick(DialogInterface var1, int var2) {
                    }
                };
                var42.setNegativeButton("Cancel", var48);
                AlertDialog var50 = var42.create();
                var50.show();
                CustomActivity.setSelector((ViewGroup)var50.getWindow().getDecorView());
                CustomActivity.setGlobalFont((ViewGroup)var50.getWindow().getDecorView());
                ((TextView)var50.findViewById(16908299)).setLinkTextColor(this.getResources().getColor(R.color.blue));
                ((TextView)var50.findViewById(16908299)).setMovementMethod(LinkMovementMethod.getInstance());
                return;
            }

            if (var3 == 8) {
                Builder var51 = new Builder(this);

                try {
                    Builder var54 = var51.setMessage(Html.fromHtml("<p>AndroBench Version " + this.getPackageManager().getPackageInfo(this.getPackageName(), 0).versionName + "<br>Developed by<br>Computer Systems Laboratory,<br>Sungkyunkwan University<br>" + "<a href=\"http://www.androbench.com\">http://www.androbench.com</a>" + "<br>androbench@gmail.com</p>")).setCancelable(false);
                    OnClickListener var55 = new OnClickListener() {
                        public void onClick(DialogInterface var1, int var2) {
                        }
                    };
                    var54.setPositiveButton("Ok", var55);
                } catch (NameNotFoundException var98) {
                    var98.printStackTrace();
                }

                AlertDialog var53 = var51.create();
                var53.setTitle("About");
                var53.setCancelable(true);
                var53.show();
                CustomActivity.setSelector((ViewGroup)var53.getWindow().getDecorView());
                CustomActivity.setGlobalFont((ViewGroup)var53.getWindow().getDecorView());
                ((TextView)var53.findViewById(16908299)).setLinkTextColor(this.getResources().getColor(R.color.blue));
                ((TextView)var53.findViewById(16908299)).setMovementMethod(LinkMovementMethod.getInstance());
                return;
            }
        }

    }

    public void onCreate(Bundle var1) {
        super.onCreate(var1);
        this.setRequestedOrientation(1);
        this.setContentView(R.layout.setting);
        this.mContext = this.getApplicationContext();
        this.sp_Data = this.getSharedPreferences("Settings", 0);
        this.sp_e_Data = this.sp_Data.edit();
        this.listview = (ListView)this.findViewById(R.id.SettingListView);
        this.al_Settings = new ArrayList();
        String var2;
        if (this.sp_Data.getInt("TargetDevice", 0) == 0) {
            var2 = "/data";
        } else {
            var2 = "unknown";
        }

        this.al_Settings.add(new Data("Target Partition", "Select partition to test", var2));
        this.al_Settings.add(new Data("File Size", "Change read/write file size", "" + this.sp_Data.getInt("OneFileSize", 0) / 1024 + " MB"));
        this.al_Settings.add(new Data("Buffer Size", "Change buffer size for sequential & random read/write", "SEQ: " + this.sp_Data.getInt("BufferSize_SEQ", 0) + " KB" + "  RND: " + this.sp_Data.getInt("BufferSize_RND", 0) + " KB"));
        this.al_Settings.add(new Data("Threads", "Change number of threads for random read/write", "Threads: " + this.sp_Data.getInt("Num_Thread", 0)));
        this.al_Settings.add(new Data("SQLite Transaction Size", "Change size of transactions for SQLite", "" + this.sp_Data.getInt("TransactionSize", 0)));
        this.al_Settings.add(new Data("SQLite Journal Mode", "Select journal mode for SQLite", this.sp_Data.getString("JournalMode", "")));
        ArrayList var9 = this.al_Settings;
        StringBuilder var10 = (new StringBuilder()).append("");
        String var11;
        if (this.sp_Data.getInt("IndexUsage", 0) == 1) {
            var11 = "YES";
        } else {
            var11 = "NO";
        }

        var9.add(new Data("SQLite Index Usage", "Select index usage for SQLite", var10.append(var11).toString()));
        this.al_Settings.add(new Data("Help", "How to use this application", ""));

        try {
            this.al_Settings.add(new Data("About", "About this application", "Ver" + this.getPackageManager().getPackageInfo(this.getPackageName(), 0).versionName));
        } catch (NameNotFoundException var15) {
            var15.printStackTrace();
        }

        if (this.al_Settings.size() > 0) {
            this.adapter = new Setting.GroupAdapter(this, R.layout.row_setting, this.al_Settings);
            this.listview.setAdapter(this.adapter);
        }

        this.listview.setOnItemClickListener(new OnItemClickListener() {
            public void onItemClick(AdapterView<?> var1, View var2, int var3, long var4) {
                Setting.this.ItemClick(var1, var2, var3, var4);
            }
        });
    }

    private class GroupAdapter extends ArrayAdapter<Object> {
        private ArrayList<Data> item;
        private Data temp;

        public GroupAdapter(Context var2, int var3, ArrayList var4) {
            super(var2, var3, var4);
            this.item = var4;
        }

        public View getView(int var1, View var2, ViewGroup var3) {
            View var4 = var2;
            this.temp = (Data)this.item.get(var1);
            if (var2 == null) {
                var4 = ((LayoutInflater)Setting.this.getSystemService(Context.LAYOUT_INFLATER_SERVICE)).inflate(R.layout.row_setting, (ViewGroup)null);
            }

            if (this.temp != null) {
                TextView var5 = (TextView)var4.findViewById(R.id.row_setting_title);
                var5.setText(this.temp.getTitle());
                TextView var6 = (TextView)var4.findViewById(R.id.row_setting_value);
                var6.setText(this.temp.getValue());
                TextView var7 = (TextView)var4.findViewById(R.id.row_setting_explain);
                var7.setText(this.temp.getExplain());
                var5.setTypeface(Typeface.createFromAsset(Setting.this.getApplicationContext().getAssets(), "fonts/PT_Sans-Web-Regular.ttf"));
                var6.setTypeface(Typeface.createFromAsset(Setting.this.getApplicationContext().getAssets(), "fonts/PT_Sans-Web-Regular.ttf"));
                var7.setTypeface(Typeface.createFromAsset(Setting.this.getApplicationContext().getAssets(), "fonts/PT_Sans-Web-Regular.ttf"));
            }

            return var4;
        }
    }
}
